package com.nkym.wypan.exception;/*
 * @ClassName BusinessException
 * @Desc TODO
 * @Author 19637
 * @Date 2023/6/5 11:53
 * @Version 1.0
 */

import com.nkym.wypan.enums.ResponseStatus;

public class BusinessException extends RuntimeException {
    private static final long serialVersionUID = 1L;


    Integer code;
    String message;

    public BusinessException() {

    }

    public BusinessException(String message) {
        this.code = 50000;
        this.message = message;
    }

    public BusinessException(ResponseStatus rs) {
        this.code = rs.getCode();
        this.message = rs.getDesc();
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
